import request from "@/api/request";
import common from "@/lib/common";
let baseURL = "";
if (process.env.NODE_ENV === 'production') {
    baseURL = common.server.bing;
} else {
    baseURL = common.devServer.bing;
}

export default {
    image(id,success, fail) {
        request.get({
            url: `${baseURL}/HPImageArchive.aspx?format=js&n=1&idx=${id}`,
            success: (res)=>{
                res.images[0].url = `https://www.bing.com${res.images[0].url}`
                success(res)
            },
            fail: fail
        })
    },
}